#-*-coding=utf-8-*-
from google.appengine.ext import db

class News(db.Model):
    tag = db.StringProperty("标签")
    title = db.StringProperty("标题")
    content = db.TextProperty("内容")
    added = db.DateTimeProperty("创建时间", auto_now_add = True)
    
    def __unicode__(self):
        return self.title
    

class Comment(db.Model):
    news = db.ReferenceProperty(News, verbose_name = "被评论的新闻", collection_name = "newspaper_comment_news")
    comment = db.TextProperty("评论")
    vote = db.IntegerProperty("支持人数")
    added = db.DateTimeProperty("创建时间", auto_now_add = True)